package com.imufe.chemicalenterprisedangerwarning.service.impl;

import com.imufe.chemicalenterprisedangerwarning.entity.po.IndustryPO;
import com.imufe.chemicalenterprisedangerwarning.entity.vo.IndustryVO;
import com.imufe.chemicalenterprisedangerwarning.mapper.IndustryMapper;
import com.imufe.chemicalenterprisedangerwarning.service.IndustryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.imufe.chemicalenterprisedangerwarning.util.ListUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 行业类别表 服务实现类
 * </p>
 *
 * @author BaiBan
 * @since 2022-09-22
 */
@Service
public class IndustryServiceImpl extends ServiceImpl<IndustryMapper, IndustryPO> implements IndustryService {

    @Autowired
    IndustryMapper mapper;

    @Override
    public List<IndustryVO> optionList() {
        List<IndustryPO> poList = mapper.selectList(null);
        // po 转 vo
        return ListUtils.copyList(poList, IndustryVO.class);
    }
}